package com.zyy.meetObject2;

public class Exer {
    public static void main(String[] args) {
        Exer exer = new Exer();
        exer.meeting(new Man(),new Woman(),new Man());
    }
    public  static void meeting(Person... ps){
        for (int i = 0; i < ps.length; i++){
            ps[i].eat();
            ps[i].toilet();
            if(ps[i] instanceof Woman){
                Woman woman = (Woman) ps[i];
                woman.makeUp();
            }else if(ps[i] instanceof Man){
                Man man = (Man) ps[i];
                man.smoke();
            }
        }
    }
}
